<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/adminjsp/taglibs.jsp"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>人人自由任务后台管理系统</title>
		<link rel="stylesheet" href="../../styles/adminCss/popupBox.css">
	</head>
	<body>
		<script type="text/javascript" src="../../javascript/adminJs/jquery.min.js"></script>
	    <script type="text/javascript" src="../../javascript/adminJs/jquery.easydrag.handler.beta2.js"></script>
	    <script type="text/javascript">
		$(document).ready(function(){
			$('#addAdmin').click(function(){	
				$('.addBox2').show();
			});	
			$('.addAdminaddBox a').click(function(){
				$('.addBox2').hide();
			});
			$('#addAdminReset').click(function(){
				$('#adminName').val("");
				$('#adminPass').val("");
				$('#adminPhone').val("");
				$('.addBox2').hide();
			});
			$('.addBox').easydrag();
		});
		function edit(id){
			$.get("/adminjsp/updateAdmin?adminId="+id,function(data){
				$("#edit").html(data);
			});
		}
		</script>
			<div class="addBox2">
				<div class="addAdminaddBox">
			    	<h4>添加管理员</h4>
			        <a href="" class="close"></a>
			    </div>
			    <div class="addAdminaddBox1">
			    	<form id="addAdminForm" name="addAdminform">
			        	<div class="addAdminaddBoxleft">
			            	<span></span>
			                <div class="addAdminaddBoxleft1">
			                	<input type="text" name="adminName" id="adminName" placeholder="管理员账号" /></input>
			                </div>
			                <div class="addAdminaddBoxleft1">
			                	<input type="text" name="adminPass" id="adminPass" placeholder="管理员密码" /></input>
			                </div>
			                <div class="addAdminaddBoxleft1">
			                	<input type="text" name="adminPhone" id="adminPhone" placeholder="管理员电话" /></input>
			                </div>
			                <div class="addAdminaddBoxleft2">
			                	<input type="button" class="dl" id ="addAdminControll" value ="添加"></input>
			                    <a id="addAdminReset" class="dl">取消</a>
			                </div>
			            </div>
			        </form>
			    </div>
			</div>
		
		<jsp:include page="top.jsp"></jsp:include>
		<div class="adminMain">
		<div class="adminLeft">
		<jsp:include page="left.jsp"></jsp:include>
		</div>
		<div class="adminRight">
		<div class="content clearfix">
	        <div class="main">
	            <!--右侧内容-->
	            <div class="cont">
	                <div class="title">管理员管理</div>
	                <div class="details">
	                    <div class="details_operation clearfix">
	                        <div class="bui_select">
	                            <input id="addAdmin" type="button" value="添&nbsp;&nbsp;加" class="add">
	                        </div>
	                    </div>
	                    <!--表格-->
	                    <table class="table" cellspacing="0" cellpadding="0">
	                        <thead>
	                            <tr>
	                                <th width="20%">管理员编号</th>
	                                <th width="25%">管理员名称</th>
	                                <th width="25%">电话号码</th>
	                                <th width="35%">操作</th>
	                            </tr>
	                        </thead>
	                        <tbody>
	                        <c:forEach var="data" items="${adminList}" varStatus="status">
	                            <tr>
	                                <!--这里的id和for里面的c1 需要循环出来-->
	                                <td><input type="checkbox" id="c1" class="check"><label for="c1" class="label">${data.adminId}</label></td>
	                                <td>${data.adminName}</td>
	                                <td>${data.adminPhone}</td>
	                                <td align="center"><a href="javascript:edit(${data.adminId})" id="updateAdmin" class="btn">修改</a>
	                                <a class="btn" href="deleteAdmin?adminId=${data.adminId}" onClick="return window.confirm('确认要删除选中的信息')">删除</a></td>
	                            </tr>
	                         </c:forEach>
	                        </tbody>
	                    </table>
	                </div>
	            </div>
	        </div>
	    </div>
	    </div>
	    </div>
	    <div id="edit" style="z-index:99;"></div>
	    <input id="updateAdmin" type="hidden" value="${updateAdminInfo.adminName}"/>
		<script type="text/javascript" src="../../javascript/adminJs/commonFunc.js"></script>
		<script type="text/javascript" src="../../javascript/adminJs/login.js"></script>
	</body>
</html>